#ifndef TTCALCOBJ_IMPL_H
#define TTCALCOBJ_IMPL_H

#include "IttCalcObj.h"

#include <list>
class ttPoint :
	public IttCalcObj
{
public:
	static const float R;
	typedef std::list<ttPoint*> THISLIST;
protected:
	int m_x, m_y;
	bool m_val;
	THISLIST m_output;
	ttPoint *m_input; 
public:
	ttPoint();	
	int setXY(int x, int y);
	int getX();
	int getY();
	int getOutputLength();
	ttPoint* getOutput(int pos);
	virtual int draw(HDC hdc);
	virtual int drawLink(HDC hdc);
	virtual int flash(HDC hdc);
	virtual bool hit(int x, int y);
	virtual int dragBegin();
	virtual int dragOver();
	virtual int destroy();
	virtual int removeOutput(ttPoint* output);
	virtual int removeInput(ttPoint *input);
	virtual int link(ttPoint *output);
	virtual int linked(ttPoint *input);
	virtual int setVal(bool val);
	virtual bool getVal();
	virtual bool calc(int depth);
	virtual bool isEnd();
	virtual COTYPE getType();
};

class andPoint :
	public ttPoint
{
protected:
	ttPoint *m_input1, *m_input2;
public:
	andPoint();
	virtual int draw(HDC hdc);
	virtual int destroy();
	virtual int removeInput(ttPoint *input);
	virtual int linked(ttPoint *input);
	virtual int setVal(bool val);
	virtual bool calc(int depth);
	virtual COTYPE getType();
};

class orPoint :
	public andPoint
{
	virtual int draw(HDC hdc);
	virtual bool calc(int depth);
	virtual COTYPE getType();
};

class notPoint :
	public ttPoint
{
public:
	notPoint();
	virtual int draw(HDC hdc);
	virtual int setVal(bool val);
	virtual bool calc(int depth);
	virtual COTYPE getType();
};
#endif